#include <stdio.h>

/**
 * 控制台的输入和输出
 */
int main(void) {
	// 收入
	float income;
	// 支出
	double expense;
	// 月、小时、分钟
	int month, hour, minute;

	/*
	 * & 地址操作符
	 *
	 * 打印16进制变量内存单元地址
	 * int i;
	 * printf("i = 0X%p\n", &i);
	 * i = 1;
	 * printf("i = 0X%p\n", &i);
	 *
	 * 结果
	 * i = 0X0000005b6a9ff66c
	 * i = 0X0000005b6a9ff66c
	 * 赋值前后内存地址没有变化
	 */

	// 键盘输入示例
	printf("What month is it?\n");
	// int 类型格式是 d
	scanf("%d", &month);
	printf("You have entered month=%5d\n", month);

	printf("Please enter your income and expenses\n");
	// float 类型格式是 f，double 类型格式是 lf
	scanf("%f %lf", &income, &expense);
	printf("Entered income=%8.2f, expenses=%8.2lf\n",
		   income, expense);
	printf("Please enter the time, e.g.,12:45\n");
	scanf("%d:%d", &hour, &minute);
	printf("Entered Time = %2d:%2d\n", hour, minute);


}